package com.hdoit.ares.web.wechat.handler;

import java.util.Map;

import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

import org.springframework.stereotype.Component;

import com.tennetcn.web.cbase.wechat.builder.BaseTextBuilder;
import com.tennetcn.web.cbase.wechat.handler.BaseMsgHandler;

/**
 * 
 * @author Binary Wang
 *
 */
@Component
public class MsgHandler extends BaseMsgHandler {

	@Override
	protected WxMpXmlOutMessage beforeHandle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) {
		if("嘿嘿".equals(wxMessage.getContent())){
			return new BaseTextBuilder().build("heihei", wxMessage);
		}
		return null;
	}

	@Override
	protected WxMpXmlOutMessage afterHandle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) {
		return null;
	}

}
